package org.taurusxi.eventbus;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * Created by chengxi on 2017/8/27.
 */
@Component
public class Sender {

    @Autowired
    private AmqpTemplate amqpTemplate;

    public void sender(){
        String context = "hello " + new Date();
        System.out.println("Sender:"+context);
        amqpTemplate.convertAndSend("hello",context);
    }

}
